package com.string;

/**
 * @Author 小闽
 * @Date 2024/9/29 17:12
 * @PackageName: com.string
 * @ClassName: StringExercise05
 * @Description: 字符串练习05
 * @Version 1.0
 */
public class StringExercise05 {
    public static void main(String[] args) {
        Person p1 = new Person();
        p1.name = "苏宁易购";
        Person p2 = new Person();
        p2.name = "苏宁易购";

        System.out.println(p1.name.equals(p2.name)); // true
        System.out.println(p1.name == p2.name); // true
        System.out.println(p1.name == "苏宁易购"); // true

        String s1 = new String("bcde");
        String s2 = new String("bcde");
        System.out.println(s1 == s2);  // false
    }
}
class Person {
    public String name;
}